package com.hmall.client;

import com.hmall.pojo.Address;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

/**
 * 用户微服务远程调用
 */
@FeignClient("userservice")
public interface UserClient {
    /*@GetMapping("/address/uid/{userId}")
    public List<Address> findAddressByUserId(@PathVariable("userId") Long userId);*/

    @GetMapping("/address/{id}")
    public Address findAddressById(@PathVariable("id") Long id);

    @PutMapping("/user/money/{userId}/{money}")
    public void deductMoney(@PathVariable("userId") Long userId,@PathVariable("money") Long money);

    @PutMapping("/user/refund/{id}/{money}")
    public void refund(@PathVariable("id") String id,@PathVariable("money") String money);
}
